package com.erdos.core.util.service.impl;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;

import javax.swing.table.TableModel;

import org.apache.poi.hssf.util.Region;

import com.erdos.common.util.excel.ExcelReader;
import com.erdos.common.util.excel.ExcelWriter;
import com.erdos.core.util.service.ExcelService;

public class ExcelServiceImpl implements ExcelService {

	public void write(InputStream formatStream, OutputStream outStream,
			String[] sheetNames, TableModel[] tables) {
		ExcelWriter.write(formatStream, outStream, sheetNames, tables);

	}

	public void write(InputStream formatStream, OutputStream outStream,
			String[] sheetNames, TableModel[] tables,
			boolean removeUnusedSheets, int groupRowNum) {
		ExcelWriter.write(formatStream, outStream, sheetNames, tables,
				removeUnusedSheets, groupRowNum);

	}

	public void write(InputStream formatStream, OutputStream outStream,
			String[] sheetNames, TableModel[] tables, int groupRowNum) {
		ExcelWriter.write(formatStream, outStream, sheetNames, tables,
				groupRowNum);

	}

	public void write(InputStream formatStream, OutputStream outStream,
			String[] sheetNames, TableModel[] tables, List<Region>[] regions,
			boolean removeUnusedSheets, int groupRowNum) {
		ExcelWriter.write(formatStream, outStream, sheetNames, tables, regions,
				removeUnusedSheets, groupRowNum);

	}

	public void write(InputStream formatStream, OutputStream outStream,
			String[] sheetNames, TableModel[] tables, List<Region>[] regions,
			TableModel[] styleTable, boolean removeUnusedSheets, int groupRowNum) {
		ExcelWriter.write(formatStream, outStream, sheetNames, tables, regions,
				removeUnusedSheets, groupRowNum);

	}

	public void write(InputStream formatStream, OutputStream outStream,
			String[] sheetNames, TableModel[] tables, List<Region>[] regions,
			TableModel[] styleTable, boolean removeUnusedSheets,
			int groupRowNum, Map<String, ByteArrayOutputStream> imageSheets) {
		ExcelWriter.write(formatStream, outStream, sheetNames, tables, regions,
				styleTable, removeUnusedSheets, groupRowNum, imageSheets);

	}

	public TableModel read(InputStream inputStream, String sheetName) {

		return ExcelReader.read(inputStream, sheetName);
	}

	public TableModel read(String fileName, String sheetName) {

		return ExcelReader.read(fileName, sheetName);
	}

}
